Release 10.1A: OpenEdge Application Server:
Developing WebSpeed Applications
Modifying the outputHeader procedure
The outputHeader procedure is the standard place to make a Web object state aware. It performs similar transaction management functions for both HTML-mapping and CGI Wrapper Web objects.
The standard WebSpeed template for this procedure contains a set of comments and a call to the output-content-type API function:
The call to
output-content-typeis required and it outputs the standard MIME header for Web pages.The comments prior to output-content-type describe how to call setWebstate (or set-web-state) and set-cookie in order to make the Web object state aware.
The setWebstate function sets the WebSpeed transaction state for the Web object. In this example, the calling Web object is made state aware with a time-out period of five minutes:
To make the Web object state aware,
setWebstatecreates the cookies that identify the WebSpeed agent and the Web object. After a time-out,setWebstatekills the cookies.The
setWebstatefunction resides ininstall-path/src/web2/admweb.p. The Web object runs this super procedure persistently to provide access to many WebSpeed method procedures and API functions.If you want to terminate the entire state-persistent WebSpeed transaction and unlock the agent, you must execute
Note: WebSpeed supports one other standard place to callsetWebstatewith the time-out period set to zero.setWebState, when handling state-aware time-outs. For more information, see the "Resetting a Web object’s time-out period" section.Although the
setWebStatefunction automatically creates the cookies that identify the WebSpeed agent, and the Web object, you may want to create additional cookies to pass other information. Theset-cookieAPI function, called after setWebState, allows you to generate additional application cookies. You can call it as many times as needed to define all your cookies.For example, the following sets a cookie,
custNum=23:
The cookie expires on the next day at midnight. Note that midnight is the default value if time is the Unknown value (
?).For more information, see the "Passing information between Web requests" section. For syntax information, see the "set-cookie" section.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |